package org.emet.entity.biz;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.emet.help.CGResource;
import org.emet.jee.console.entity.BaseEntity;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.Cascade;

/**
 * Hall 租用记录
 * @author alex
 *
 */
@Entity
@Table(name = "T_HALL_RENT")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class HallRent extends BaseEntity {
	@CGResource("xxxxxx")
	private Registration registration;
	//The name of hall
	private Long hallId;
	@CGResource("大厅名称")
	private String hall;
	@CGResource("开始时间")
	private Date startDate;
	@CGResource("结束时间")
	private Date endDate;
	private BigDecimal totalCharge;
	private Boolean paied = false;
	@CGResource("工作人员")
	private String worker;
	@CGResource("备注")
	private String remark;

	public Boolean isPaied() {
		return paied;
	}

	public void setPaied(Boolean paied) {
		this.paied = paied;
	}

	public BigDecimal getTotalCharge() {
		return totalCharge;
	}

	public void setTotalCharge(BigDecimal totalCharge) {
		this.totalCharge = totalCharge;
	}

	@ManyToOne(targetEntity = Registration.class)
	@Cascade({ org.hibernate.annotations.CascadeType.SAVE_UPDATE })
	@JoinColumn(name = "reg_id")
	public Registration getRegistration() {
		return registration;
	}

	public void setRegistration(Registration registration) {
		this.registration = registration;
	}

	public String getHall() {
		return hall;
	}

	public void setHall(String hall) {
		this.hall = hall;
	}

	public Long getHallId() {
		return hallId;
	}

	public void setHallId(Long hallId) {
		this.hallId = hallId;
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public String getWorker() {
		return worker;
	}

	public void setWorker(String worker) {
		this.worker = worker;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this);
	}
}
